package org.jeecg.common.util;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

public class FilterUtil {
    /**
     * 获取Post请求参数
     *  @param req HttpServletRequest 请求对象
     * @return
     */
    public static Map<String, String[]> getSortMap(HttpServletRequest req, String column, String sort) {
        Map<String, String[]> sourceMap = req.getParameterMap();
        Map<String, String[]> handleMap = CloneUtil.cloneMap(sourceMap);

        String[] orderConditions = {sort};
        String[] orderColumn = {column};
        handleMap.put("column", orderColumn);
        handleMap.put("order", orderConditions);

        return handleMap;
    }
}
